package com.alibaba.algo.cooperation.usercomponent.service.user;

import com.alibaba.algo.cooperation.common.BaseResult;
import com.alibaba.algo.cooperation.common.PagerEntity;
import com.alibaba.algo.cooperation.usercomponent.vo.req.user.SelectRoleListByUserRequestVO;
import com.alibaba.algo.cooperation.usercomponent.vo.req.user.SelectUserRoleRequestVO;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RequestParam;

import java.time.LocalDateTime;

/**
 * 类SysUserRoleService.java的实现描述：用户角色关联 service
 *
 * @author nieganggang 2021-03-12 16:08:17
 */
@FeignClient(url="${feign.userCenterUrl:}", value = "usercenter-service", contextId = "usercenter-app")
public interface SysUserRoleService {

    @RequestMapping(value = "/sysUserRole/insert", method = RequestMethod.POST)
    void insert(@RequestParam("userId") Long userId, @RequestParam("roleId") Long roleId);

    @RequestMapping(value = "/sysUserRole/delete", method = RequestMethod.POST)
    void delete(@RequestParam("userId") Long userId);

    @RequestMapping(value = "/sysUserRole/updateIsDeletedByUserIdLastModified", method = RequestMethod.POST)
    void updateIsDeletedByUserIdLastModified(@RequestParam("userId") Long userId,@RequestParam("lastModifyTime") LocalDateTime lastModifyTime);

    @RequestMapping(value = "/sysUserRole/update", method = RequestMethod.POST)
    void update(@RequestParam("userId") Long userId, @RequestParam("roleId") Long roleId);

    @RequestMapping(value = "/sysUserRole/selectPage", method = RequestMethod.POST)
    PagerEntity selectPage(@RequestBody SelectUserRoleRequestVO vo);

    @RequestMapping(value = "/sysUserRole/selectRoleCodeByUser", method = RequestMethod.POST)
    BaseResult selectRoleCodeByUser(@RequestBody SelectRoleListByUserRequestVO vo);
}
